<template>
	<view>
		<view class="comment-main" v-for="(item, index) in commentlist" :key="index">
			<view class="comment-info">
				<text class="user-name">{{ item.choicename }}</text>
				<van-rate :value="item.score" :count="5" readonly size="14"/>
				<text class="comment-date">{{ item.commentdate.split('T')[0] }}</text>
			</view>
			<view class="comment-content">{{ item.content }}</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"shop-comment",
		props: {
			commentlist: {
				type: Array,
				require: true
			}
		},
		data() {
			return {
				
			};
		}
	}
</script>

<style>
	.comment-main {
		border-bottom: 2px solid #f8f8f8;
		padding: 30rpx;
	}
	
	.comment-info {
		display: flex;
		justify-content: flex-start;
		align-items: center;
		font-size: 14px;
	}
	
	.comment-date {
		margin-left: auto;
		color: #9999b3;
		font-size: 13px;
	}
	
	.comment-content {
		font-size: 13px;
		letter-spacing: 1px;
		padding: 15rpx 0;
	}
	
	.user-name {
		width: 45%;
		text-overflow: ellipsis;
		overflow: hidden;
		white-space: nowrap;
	}
</style>